Integrand size = 28, antiderivative size = 138 \[ \int \frac {\cos ^3(c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^2} \, dx=-\frac {3 a b^2 \text {arctanh}\left (\frac {b \cos (c+d x)-a \sin (c+d x)}{\sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{5/2} d}+\frac {2 a b \cos (c+d x)}{\left (a^2+b^2\right )^2 d}+\frac {\left (a^2-b^2\right ) \sin (c+d x)}{\left (a^2+b^2\right )^2 d}-\frac {b^3}{\left (a^2+b^2\right )^2 d (a \cos (c+d x)+b \sin (c+d x))} \]
[Out]
Time = 1.31 (sec) , antiderivative size = 231, normalized size of antiderivative = 1.67, number of steps used = 11, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {6874, 653, 209, 652, 632, 212} \[ \int \frac {\cos ^3(c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^2} \, dx=-\frac {2 b^2 \left (3 a^2+b^2\right ) \text {arctanh}\left (\frac {b-a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )}{a d \left (a^2+b^2\right )^{5/2}}+\frac {2 b^4 \text {arctanh}\left (\frac {b-a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )}{a d \left (a^2+b^2\right )^{5/2}}+\frac {2 \left (\left (a^2-b^2\right ) \tan \left (\frac {1}{2} (c+d x)\right )+2 a b\right )}{d \left (a^2+b^2\right )^2 \left (\tan ^2\left (\frac {1}{2} (c+d x)\right )+1\right )}-\frac {2 b^3 \left (a+b \tan \left (\frac {1}{2} (c+d x)\right )\right )}{a d \left (a^2+b^2\right )^2 \left (-a \tan ^2\left (\frac {1}{2} (c+d x)\right )+a+2 b \tan \left (\frac {1}{2} (c+d x)\right )\right )} \]
[In]
[Out]
Rule 209
Rule 212
Rule 632
Rule 652
Rule 653
Rule 6874
Rubi steps \begin{align*} \text {integral}& = \frac {2 \text {Subst}\left (\int \frac {\left (1-x^2\right )^3}{\left (1+x^2\right )^2 \left (a+2 b x-a x^2\right )^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{d} \\ & = \frac {2 \text {Subst}\left (\int \left (\frac {2 \left (a^2-b^2-2 a b x\right )}{\left (a^2+b^2\right )^2 \left (1+x^2\right )^2}+\frac {-a^2+b^2}{\left (a^2+b^2\right )^2 \left (1+x^2\right )}-\frac {2 b^3 x}{a \left (a^2+b^2\right ) \left (-a-2 b x+a x^2\right )^2}-\frac {b^2 \left (3 a^2+b^2\right )}{a \left (a^2+b^2\right )^2 \left (-a-2 b x+a x^2\right )}\right ) \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{d} \\ & = \frac {4 \text {Subst}\left (\int \frac {a^2-b^2-2 a b x}{\left (1+x^2\right )^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{\left (a^2+b^2\right )^2 d}-\frac {\left (2 \left (a^2-b^2\right )\right ) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{\left (a^2+b^2\right )^2 d}-\frac {\left (4 b^3\right ) \text {Subst}\left (\int \frac {x}{\left (-a-2 b x+a x^2\right )^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{a \left (a^2+b^2\right ) d}-\frac {\left (2 b^2 \left (3 a^2+b^2\right )\right ) \text {Subst}\left (\int \frac {1}{-a-2 b x+a x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{a \left (a^2+b^2\right )^2 d} \\ & = -\frac {\left (a^2-b^2\right ) x}{\left (a^2+b^2\right )^2}+\frac {2 \left (2 a b+\left (a^2-b^2\right ) \tan \left (\frac {1}{2} (c+d x)\right )\right )}{\left (a^2+b^2\right )^2 d \left (1+\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )}-\frac {2 b^3 \left (a+b \tan \left (\frac {1}{2} (c+d x)\right )\right )}{a \left (a^2+b^2\right )^2 d \left (a+2 b \tan \left (\frac {1}{2} (c+d x)\right )-a \tan ^2\left (\frac {1}{2} (c+d x)\right )\right )}+\frac {\left (2 b^4\right ) \text {Subst}\left (\int \frac {1}{-a-2 b x+a x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{a \left (a^2+b^2\right )^2 d}+\frac {\left (2 \left (a^2-b^2\right )\right ) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{\left (a^2+b^2\right )^2 d}+\frac {\left (4 b^2 \left (3 a^2+b^2\right )\right ) \text {Subst}\left (\int \frac {1}{4 \left (a^2+b^2\right )-x^2} \, dx,x,-2 b+2 a \tan \left (\frac {1}{2} (c+d x)\right )\right )}{a \left (a^2+b^2\right )^2 d} \\ & = -\frac {2 b^2 \left (3 a^2+b^2\right ) \text {arctanh}\left (\frac {b-a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )}{a \left (a^2+b^2\right )^{5/2} d}+\frac {2 \left (2 a b+\left (a^2-b^2\right ) \tan \left (\frac {1}{2} (c+d x)\right )\right )}{\left (a^2+b^2\right )^2 d \left (1+\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )}-\frac {2 b^3 \left (a+b \tan \left (\frac {1}{2} (c+d x)\right )\right )}{a \left (a^2+b^2\right )^2 d \left (a+2 b \tan \left (\frac {1}{2} (c+d x)\right )-a \tan ^2\left (\frac {1}{2} (c+d x)\right )\right )}-\frac {\left (4 b^4\right ) \text {Subst}\left (\int \frac {1}{4 \left (a^2+b^2\right )-x^2} \, dx,x,-2 b+2 a \tan \left (\frac {1}{2} (c+d x)\right )\right )}{a \left (a^2+b^2\right )^2 d} \\ & = \frac {2 b^4 \text {arctanh}\left (\frac {b-a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )}{a \left (a^2+b^2\right )^{5/2} d}-\frac {2 b^2 \left (3 a^2+b^2\right ) \text {arctanh}\left (\frac {b-a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )}{a \left (a^2+b^2\right )^{5/2} d}+\frac {2 \left (2 a b+\left (a^2-b^2\right ) \tan \left (\frac {1}{2} (c+d x)\right )\right )}{\left (a^2+b^2\right )^2 d \left (1+\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )}-\frac {2 b^3 \left (a+b \tan \left (\frac {1}{2} (c+d x)\right )\right )}{a \left (a^2+b^2\right )^2 d \left (a+2 b \tan \left (\frac {1}{2} (c+d x)\right )-a \tan ^2\left (\frac {1}{2} (c+d x)\right )\right )} \\ \end{align*}
Time = 1.31 (sec) , antiderivative size = 130, normalized size of antiderivative = 0.94 \[ \int \frac {\cos ^3(c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^2} \, dx=\frac {\frac {12 a b^2 \text {arctanh}\left (\frac {-b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{5/2}}+\frac {3 b \left (a^2-b^2\right )+b \left (a^2+b^2\right ) \cos (2 (c+d x))+a \left (a^2+b^2\right ) \sin (2 (c+d x))}{\left (a^2+b^2\right )^2 (a \cos (c+d x)+b \sin (c+d x))}}{2 d} \]
[In]
[Out]
Time = 0.76 (sec) , antiderivative size = 172, normalized size of antiderivative = 1.25
method | result | size |
derivativedivides | \(\frac {-\frac {2 \left (\left (-a^{2}+b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 a b \right )}{\left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )}-\frac {2 b^{2} \left (\frac {-\frac {b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a}-b}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a}-\frac {3 a \,\operatorname {arctanh}\left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{\sqrt {a^{2}+b^{2}}}\right )}{\left (a^{2}+b^{2}\right )^{2}}}{d}\) | \(172\) |
default | \(\frac {-\frac {2 \left (\left (-a^{2}+b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 a b \right )}{\left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )}-\frac {2 b^{2} \left (\frac {-\frac {b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a}-b}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a}-\frac {3 a \,\operatorname {arctanh}\left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{\sqrt {a^{2}+b^{2}}}\right )}{\left (a^{2}+b^{2}\right )^{2}}}{d}\) | \(172\) |
risch | \(-\frac {i {\mathrm e}^{i \left (d x +c \right )}}{2 \left (-2 i b a +a^{2}-b^{2}\right ) d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )}}{2 \left (2 i b a +a^{2}-b^{2}\right ) d}-\frac {2 i b^{3} {\mathrm e}^{i \left (d x +c \right )}}{\left (-i a +b \right )^{2} d \left (i a +b \right )^{2} \left (b \,{\mathrm e}^{2 i \left (d x +c \right )}+i a \,{\mathrm e}^{2 i \left (d x +c \right )}-b +i a \right )}+\frac {3 b^{2} a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{5}+2 i a^{3} b^{2}+i a \,b^{4}-a^{4} b -2 a^{2} b^{3}-b^{5}}{\left (a^{2}+b^{2}\right )^{\frac {5}{2}}}\right )}{\left (a^{2}+b^{2}\right )^{\frac {5}{2}} d}-\frac {3 b^{2} a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{5}+2 i a^{3} b^{2}+i a \,b^{4}-a^{4} b -2 a^{2} b^{3}-b^{5}}{\left (a^{2}+b^{2}\right )^{\frac {5}{2}}}\right )}{\left (a^{2}+b^{2}\right )^{\frac {5}{2}} d}\) | \(295\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 302 vs. \(2 (134) = 268\).
Time = 0.28 (sec) , antiderivative size = 302, normalized size of antiderivative = 2.19 \[ \int \frac {\cos ^3(c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^2} \, dx=\frac {2 \, a^{4} b - 2 \, a^{2} b^{3} - 4 \, b^{5} + 2 \, {\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (a^{5} + 2 \, a^{3} b^{2} + a b^{4}\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + 3 \, {\left (a^{2} b^{2} \cos \left (d x + c\right ) + a b^{3} \sin \left (d x + c\right )\right )} \sqrt {a^{2} + b^{2}} \log \left (-\frac {2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a^{2} - b^{2} + 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) - a \sin \left (d x + c\right )\right )}}{2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}}\right )}{2 \, {\left ({\left (a^{7} + 3 \, a^{5} b^{2} + 3 \, a^{3} b^{4} + a b^{6}\right )} d \cos \left (d x + c\right ) + {\left (a^{6} b + 3 \, a^{4} b^{3} + 3 \, a^{2} b^{5} + b^{7}\right )} d \sin \left (d x + c\right )\right )}} \]
[In]
[Out]
Timed out. \[ \int \frac {\cos ^3(c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^2} \, dx=\text {Timed out} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 348 vs. \(2 (134) = 268\).
Time = 0.32 (sec) , antiderivative size = 348, normalized size of antiderivative = 2.52 \[ \int \frac {\cos ^3(c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^2} \, dx=-\frac {\frac {3 \, a b^{2} \log \left (\frac {b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \sqrt {a^{2} + b^{2}}}{b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \sqrt {a^{2} + b^{2}}}\right )}{{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \sqrt {a^{2} + b^{2}}} - \frac {2 \, {\left (2 \, a^{3} b - a b^{3} - \frac {3 \, a b^{3} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {{\left (a^{4} + 3 \, a^{2} b^{2} - b^{4}\right )} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {{\left (a^{4} - a^{2} b^{2} + b^{4}\right )} \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}\right )}}{a^{6} + 2 \, a^{4} b^{2} + a^{2} b^{4} + \frac {2 \, {\left (a^{5} b + 2 \, a^{3} b^{3} + a b^{5}\right )} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {2 \, {\left (a^{5} b + 2 \, a^{3} b^{3} + a b^{5}\right )} \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} - \frac {{\left (a^{6} + 2 \, a^{4} b^{2} + a^{2} b^{4}\right )} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}}}{d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 286 vs. \(2 (134) = 268\).
Time = 0.36 (sec) , antiderivative size = 286, normalized size of antiderivative = 2.07 \[ \int \frac {\cos ^3(c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^2} \, dx=-\frac {\frac {3 \, a b^{2} \log \left (\frac {{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \sqrt {a^{2} + b^{2}}} - \frac {2 \, {\left (a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 3 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, a^{3} b + a b^{3}\right )}}{{\left (a^{5} + 2 \, a^{3} b^{2} + a b^{4}\right )} {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 2 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a\right )}}}{d} \]
[In]
[Out]
Time = 26.06 (sec) , antiderivative size = 286, normalized size of antiderivative = 2.07 \[ \int \frac {\cos ^3(c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^2} \, dx=\frac {\frac {4\,a^2\,b-2\,b^3}{a^4+2\,a^2\,b^2+b^4}-\frac {6\,b^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{a^4+2\,a^2\,b^2+b^4}+\frac {2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^4+3\,a^2\,b^2-b^4\right )}{a\,\left (a^4+2\,a^2\,b^2+b^4\right )}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (2\,a^4-2\,a^2\,b^2+2\,b^4\right )}{a\,\left (a^4+2\,a^2\,b^2+b^4\right )}}{d\,\left (-a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\right )}-\frac {6\,a\,b^2\,\mathrm {atanh}\left (\frac {a^4\,b+b^5+2\,a^2\,b^3-a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^4+2\,a^2\,b^2+b^4\right )}{{\left (a^2+b^2\right )}^{5/2}}\right )}{d\,{\left (a^2+b^2\right )}^{5/2}} \]
[In]
[Out]